package com.company.ecis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.company.ecis.entity.BankCard;
import com.company.ecis.mapper.BankCardMapper;
import com.company.ecis.service.BankCardService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-08-04
 */
@Service
public class BankCardServiceImpl extends ServiceImpl<BankCardMapper, BankCard> implements BankCardService {

    @Autowired
    private BankCardMapper bankCardMapper;

    @Override
    public BankCard getBankCardBycardNumber(String cardNumber) {
        QueryWrapper<BankCard> wrapper = new QueryWrapper<>();
        wrapper.eq("id",cardNumber);
        return bankCardMapper.selectOne(wrapper);
    }

    @Override
    public void updateBankCard(BankCard bankCard) {
        bankCardMapper.updateById(bankCard);
    }
}
